<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jquery3.3.1.js"></script>
    <style>
        #box1,#box2{width: 200px;height: 200px;background-color: red;
        overflow: hidden;float: left;margin-right: 20px;}
        #box1 p, #box2 p{ width: 100px;height: 100px;background-color: yellow;margin: 50px auto; }
    </style>
</head>
<body>
    <!-- <button class="btn">mouseover</button> -->
    <div id="box1">
        mouseover父
        <p>111</p>
    </div>
    <div id="box2">
        mouseenter目标点
        <p>222</p>
    </div>
    <script>
        $(function(){
            var obox1=document.getElementById('box1');
            var p1=obox1.getElementsByTagName("p")[0];

            var obox2=document.getElementById('box2');
            var p2=obox2.getElementsByTagName("p")[0];

            $("#box1").mouseover(function(){
                $(p1).text(parseInt($(p1).text())+1)
            })
            $("#box2").mouseenter(function(){
                $(p2).text(parseInt($(p2).text())+1)
            })
        })
    </script>

    <!-- keydown ,keyup ,keypress. -->


    <script>
        // $(function(){
        //     $(".btn").click(function () {
        //         alert("click事件")
        //     })
        // })

        // mouseenter 事件只加到目标点
        // mouseleave 鼠标离开

        // mouseover事件加到父级,子元素会有影响
        // mouseout 事件加到父级,子元素会有影响
    </script>
</body>
</html>